package com.todo.biz.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2024/3/13 19:52
 * @description
 */
@AllArgsConstructor
@Getter
public enum ExamineTypeEnum {

    TEXT(1, "TEXT", "文本"),
    IMG(2, "IMG", "图片"),
    VIDEO(3, "VIDEO", "视频"),
    AUDIO(4, "AUDIO", "音频"),
    ;

    private static Map<Integer, ExamineTypeEnum> typeMap = Arrays
            .stream(ExamineTypeEnum.values())
            .collect(Collectors.toMap(ExamineTypeEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static ExamineTypeEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
